#include<func.h>
//关闭文件后，文件不可再次被读取
int main(int argc,char *argv[])
{
    ARGS_CHECK(argc,2);
    int fd;
    fd=open(argv[1],O_RDWR);
    ERROR_CHECK(fd,-1,"open");
    printf("fd=%d\n",fd);
    int fd1=fd;//文件描述符赋值
    close(fd);
    char buf[128]={0};
    int ret;
    ret=read(fd,buf,sizeof(buf));
    ERROR_CHECK(ret,-1,"read");
    printf("%s",buf);
    close(fd1);
    return 0;
}